/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package sv.com.globalsolutionslt.entidades;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author karinaMelara
 */
@Entity
@Table(name = "detalle_habilidades", catalog = "bolsadetrabajo", schema = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "DetalleHabilidades.findAll", query = "SELECT d FROM DetalleHabilidades d"),
    @NamedQuery(name = "DetalleHabilidades.findByIdDetalleHabil", query = "SELECT d FROM DetalleHabilidades d WHERE d.idDetalleHabil = :idDetalleHabil"),
    @NamedQuery(name = "DetalleHabilidades.findByFechaMod", query = "SELECT d FROM DetalleHabilidades d WHERE d.fechaMod = :fechaMod"),
    @NamedQuery(name = "DetalleHabilidades.findByUsuarioMod", query = "SELECT d FROM DetalleHabilidades d WHERE d.usuarioMod = :usuarioMod")})
public class DetalleHabilidades implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_detalle_habil", nullable = false)
    private Integer idDetalleHabil;
    @Basic(optional = false)
    @NotNull
    @Column(name = "fecha_mod", nullable = false)
    @Temporal(TemporalType.DATE)
    private Date fechaMod;
    @Basic(optional = false)
    @NotNull
    @Column(name = "usuario_mod", nullable = false)
    private int usuarioMod;
    @JoinColumn(name = "id_persona", referencedColumnName = "id_persona", nullable = false)
    @ManyToOne(optional = false)
    private Persona idPersona;
    @JoinColumn(name = "id_habilidad", referencedColumnName = "id_habilidad", nullable = false)
    @ManyToOne(optional = false)
    private Habilidad idHabilidad;

    public DetalleHabilidades() {
    }

    public DetalleHabilidades(Integer idDetalleHabil) {
        this.idDetalleHabil = idDetalleHabil;
    }

    public DetalleHabilidades(Integer idDetalleHabil, Date fechaMod, int usuarioMod) {
        this.idDetalleHabil = idDetalleHabil;
        this.fechaMod = fechaMod;
        this.usuarioMod = usuarioMod;
    }

    public Integer getIdDetalleHabil() {
        return idDetalleHabil;
    }

    public void setIdDetalleHabil(Integer idDetalleHabil) {
        this.idDetalleHabil = idDetalleHabil;
    }

    public Date getFechaMod() {
        return fechaMod;
    }

    public void setFechaMod(Date fechaMod) {
        this.fechaMod = fechaMod;
    }

    public int getUsuarioMod() {
        return usuarioMod;
    }

    public void setUsuarioMod(int usuarioMod) {
        this.usuarioMod = usuarioMod;
    }

    public Persona getIdPersona() {
        return idPersona;
    }

    public void setIdPersona(Persona idPersona) {
        this.idPersona = idPersona;
    }

    public Habilidad getIdHabilidad() {
        return idHabilidad;
    }

    public void setIdHabilidad(Habilidad idHabilidad) {
        this.idHabilidad = idHabilidad;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idDetalleHabil != null ? idDetalleHabil.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof DetalleHabilidades)) {
            return false;
        }
        DetalleHabilidades other = (DetalleHabilidades) object;
        if ((this.idDetalleHabil == null && other.idDetalleHabil != null) || (this.idDetalleHabil != null && !this.idDetalleHabil.equals(other.idDetalleHabil))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "sv.com.globalsolutionslt.entidades.DetalleHabilidades[ idDetalleHabil=" + idDetalleHabil + " ]";
    }
    
}
